﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Entity
{
    /// <summary>
    /// 数据模型基础类
    /// </summary>
    [Table("PP001")]
    public class EntityBase
    {
        public EntityBase()
        {
            this.ID = Guid.NewGuid();
            this.IsLOck = false;
            this.IsDelete = false;
            this.CreatTime = DateTime.Now;
        }

        //[Key]
        //[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        ///// <summary>
        ///// 自增ID//不推荐使用
        ///// </summary>
        //public int AutoID { get; set; }

        [Key]
        [Column("P001")]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        /// <summary>
        /// 主键ID
        /// </summary>
        public Guid ID { get; set; }

        [Column("P002")]
        /// <summary>
        /// 是否被锁定
        /// </summary>
        public Boolean IsLOck { get; set; }

        [Column("P003")]
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDelete { get; set; }

        [Column("P004")]
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatTime { get; set; }
    }
}
